/**
 * 获取url中传递的参数
 * @param ctx
 */
function getUrlParam(ctx) {
    let name, value;
    let str = location.href; //取得整个地址栏
    let num = str.indexOf("?");
    str = str.substr(num + 1); //取得所有参数   stringvar.substr(start [, length ]

    const arr = str.split("&"); //各个参数放到数组里
    let options = {};
    for (let i = 0; i < arr.length; i++) {
        num = arr[i].indexOf("=");
        if (num > 0) {
            name = arr[i].substring(0, num);
            value = arr[i].substr(num + 1);
            options[name] = value;
        }
    }
    ctx.options = options
}

/**
 * 显示loading框
 * @returns {*}
 */
function showLoading(ctx) {
    return ctx.$loading({
        lock: true,
        text: 'Loading',
        spinner: 'el-icon-loading',
        background: 'rgba(255, 255, 255, 0.7)'
    });
}